package cn.droidlover.xdroidmvp.load;

import android.app.Dialog;
import android.content.Context;
import android.view.Gravity;
import android.widget.TextView;


import com.wang.avi.AVLoadingIndicatorView;

import cn.droidlover.xdroidmvp.R;

public class LoadingDialog extends Dialog {

    private Context context = null;

    private static LoadingDialog customProgressDialog = null;

    private static AVLoadingIndicatorView AVI;

//    private static TextView tv_load;// 加载的文字展示

    public LoadingDialog(Context context, int theme) {
        super(context, theme);
        this.context = context;
    }

    public static LoadingDialog createDialog(Context context) {
        customProgressDialog = new LoadingDialog(context, R.style.myDialogTheme2);
        customProgressDialog.setContentView(R.layout.dialog_loading);
        AVI = (AVLoadingIndicatorView) customProgressDialog.findViewById(R.id.avi);
//        tv_load = (TextView) customProgressDialog.findViewById(R.id.tv_load);
        customProgressDialog.getWindow().getAttributes().gravity = Gravity.CENTER;
        customProgressDialog.setCancelable(false);
        return customProgressDialog;
    }

    public void Show() {
//        tv_load.setText("加载中");
        show();
    }

//    public void resumeText() {
//        tv_load.setText("加载中");
//    }
//
//    public void Show(String str) {
//        tv_load.setText(str);
//        show();
//    }


    public void Dismiss() {
        dismiss();
    }
}
